import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sports_new/resources/colours.dart';
import 'package:sports_new/resources/styles.dart';
import 'base/qkd_text.dart';
import 'base/qkd_button.dart';

class DescribeDialog extends StatelessWidget {
  const DescribeDialog(
      {super.key,
      required this.content,
      required this.title,
      required this.confirmText});

  final String title;
  final List<String> content;
  final String confirmText;

  @override
  Widget build(BuildContext context) {
    return Dialog(
      backgroundColor: Colors.transparent,
      child: Container(
        width: 280,
        padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 16),
        decoration: BoxDecoration(
            color: Colours.white, borderRadius: BorderRadius.circular(8)),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            QkdText(title, fontWeight: FontWeight.w500,fontSize: 16),
            Padding(
              padding: const EdgeInsets.symmetric(vertical: 16),
              child: Column(
                children: List.generate(
                  content.length,
                  (index) => Padding(
                    padding: EdgeInsets.only(top: index == 0 ? 0 : 5),
                    child: QkdText(
                      content[index].split('').join("\u200A"),
                      color: Colours.grey666666,
                      letterSpacing: -0.3,
                      textAlign: TextAlign.justify,
                    ),
                  ),
                ),
              ),
            ),
            QkdButton(
              width: Get.width,
              height: 44,
              onPressed: Get.back,
              backgroundColor: Colours.main,
              text: confirmText,
              borderRadius: 4,
              textStyle: const TextStyle(color: Colours.white, fontSize: 16),
            ),
          ],
        ),
      ),
    );
  }
}
